/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bd_registro_civil;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Earving
 */
@Entity
@Table(name = "testigo")
@NamedQueries({
    @NamedQuery(name = "Testigo.findAll", query = "SELECT t FROM Testigo t"),
    @NamedQuery(name = "Testigo.findByIdTestigo", query = "SELECT t FROM Testigo t WHERE t.idTestigo = :idTestigo"),
    @NamedQuery(name = "Testigo.findByNombre", query = "SELECT t FROM Testigo t WHERE t.nombre = :nombre"),
    @NamedQuery(name = "Testigo.findByApp", query = "SELECT t FROM Testigo t WHERE t.app = :app"),
    @NamedQuery(name = "Testigo.findByApm", query = "SELECT t FROM Testigo t WHERE t.apm = :apm"),
    @NamedQuery(name = "Testigo.findByNacionalidad", query = "SELECT t FROM Testigo t WHERE t.nacionalidad = :nacionalidad"),
    @NamedQuery(name = "Testigo.findByEdad", query = "SELECT t FROM Testigo t WHERE t.edad = :edad")})
public class Testigo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_testigo")
    private Integer idTestigo;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @Column(name = "app")
    private String app;
    @Column(name = "apm")
    private String apm;
    @Basic(optional = false)
    @Column(name = "nacionalidad")
    private String nacionalidad;
    @Column(name = "edad")
    private String edad;
    @JoinColumn(name = "id_acta", referencedColumnName = "id_acta")
    @ManyToOne(optional = false)
    private Acta acta;

    public Testigo() {
    }

    public Testigo(Integer idTestigo) {
        this.idTestigo = idTestigo;
    }

    public Testigo(Integer idTestigo, String nombre, String app, String nacionalidad) {
        this.idTestigo = idTestigo;
        this.nombre = nombre;
        this.app = app;
        this.nacionalidad = nacionalidad;
    }

    public Integer getIdTestigo() {
        return idTestigo;
    }

    public void setIdTestigo(Integer idTestigo) {
        this.idTestigo = idTestigo;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getApp() {
        return app;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public String getApm() {
        return apm;
    }

    public void setApm(String apm) {
        this.apm = apm;
    }

    public String getNacionalidad() {
        return nacionalidad;
    }

    public void setNacionalidad(String nacionalidad) {
        this.nacionalidad = nacionalidad;
    }

    public String getEdad() {
        return edad;
    }

    public void setEdad(String edad) {
        this.edad = edad;
    }

    public Acta getActa() {
        return acta;
    }

    public void setActa(Acta acta) {
        this.acta = acta;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTestigo != null ? idTestigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Testigo)) {
            return false;
        }
        Testigo other = (Testigo) object;
        if ((this.idTestigo == null && other.idTestigo != null) || (this.idTestigo != null && !this.idTestigo.equals(other.idTestigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bd_registro_civil.Testigo[idTestigo=" + idTestigo + "]";
    }

}
